<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="app">

       <h1>{{message | toUpper}}</h1>
       <h1>{{msg2 | tolower}}</h1>
       <!-- 写一个过滤器 去加密 密码  -->
       <h1>{{secret |  }}</h1>
    </div>


    <script>
        // 全局过滤器  用Vue来定义

       Vue.filter('toUpper',(val)=>{
            return val.toUpperCase()
        })
   
        var app = new Vue({
            el: '#app',
            data: {
                message: 'helloworld',
                msg2:'VUE HELLO',
                secret:'123456'
                // 1bc2bc3bc5bc6bc
            },
            filters:{
                tolower:(val)=>{
                    return val.toLowerCase()
                },

            }
        })

        console.log('app', app)

    </script>
</body>

</html>